<template>
  <div class="main-header">
    <div class="menu-icon" @click="handleMenuIconClick">
      <el-icon size="25px" v-if="isFold"><Expand /></el-icon>
      <el-icon size="25px" v-else><Fold /></el-icon>
    </div>
    <div class="content">
      <div class="breadcrumb">
        <headerCrumb />
      </div>
      <div class="info">
        <headerInfo/>
      </div>
    </div>
    
  </div>
</template>

<script lang="ts" setup>
import headerCrumb from './c-cpns/header-crumb.vue';
import headerInfo from './c-cpns/header-info.vue'
import { ref } from 'vue'

const emit = defineEmits(['foldChange'])
const isFold = ref(false)
const handleMenuIconClick = () => {
  isFold.value = !isFold.value
  //自定义事件传递给父组件
  emit('foldChange', isFold.value)
}




</script>

<style lang="less" scoped>
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 49px;
  box-shadow: 0px 1px 0px 0px #c7c9cb4d;
  .menu-icon {
    display: flex;
    align-items: center;
    cursor: pointer;
  }
  .content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    padding:0 18px;
  }
}
</style>